<?php
namespace Home\Common;
use Think\Controller;
class CommonController extends Controller {

	public function _initialize(){
		if(!isset($_SESSION['uid'])){
			//$this->error('操作失败',U('Error/Page500'),1);
			$this->redirect('Error/unlogin');
		}
		else{
			$s_name=$_SESSION['name'];
			$s_lpt=$_SESSION['lpt'];
			$version = C('VERSION_NUMBER');
			$s_companyname=$_SESSION['companyname'];
			$s_rolelist=$_SESSION['rolelist'];
			
			
			
			$this->assign('version',$version);
			$this->assign('s_lpt',$s_lpt);
			$this->assign('s_name',$s_name);
			$this->assign('s_companyname',$s_companyname);
			$this->assign('s_rolelist',$s_rolelist);
			
			//cookie
			$value = cookie('sidebarStatus');
			$this->assign('sidebarStatus',$value);
		}
	}
}